<!--
 * @Author: 矫建武 1452239416@qq.com
 * @Date: 2024-10-12 16:00:53
 * @LastEditTime: 2024-10-18 09:51:55
 * @FilePath: \tool\src\views\tool\qrcode.vue
 * @Description: 
 * 
 * @file: https://github.com/OBKoro1/koro1FileHeader/wiki/%E5%AE%89%E8%A3%85%E5%92%8C%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B
-->
<!-- 模块说明 -->
<style lang="scss" scoped>
.qrcodeItem {
  display: flex;
  align-items: center;
  .qrcodeUrl {
    width: 700px;
    height: 280px;
    margin-left: 20px;
    display: flex;
    align-items: center;
  }
}
</style>

<template>
  <div>
    <section class="qrcodeItem">
      <div class="qrcodeUrl">
        <el-input v-model="textarea" type="textarea" :autosize="{ minRows: 8 }" />
      </div>
      <Qrcode :qrUrl="textarea" />
    </section>
  </div>
</template>

<script setup>
import Qrcode from '@/components/generateQrCode/index.vue'
import { ref, onMounted, watch } from 'vue'
const textarea = ref('')

onMounted(() => {
  const _textarea = localStorage.getItem('textarea')
  if (_textarea) textarea.value = _textarea
})

watch(textarea, () => {
  localStorage.setItem('textarea', textarea.value)
})
</script>
